Skip to content

Change flag ordering #1403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Change flag ordering #1403

merged 1 commit into from
Feb 24, 2025

Conversation

madsmtm
Copy link
Collaborator

@madsmtm madsmtm commented Feb 14, 2025

To allow flags set on the builder with Build::flag/Build::flag_if_supported to override other flags, and to allow CFLAGS to override all other flags.

Found while doing #1401.

Now the order of flags are as follows, with later flags overriding previous ones. I've also here shown who "controls" which flag, to make it clear why we want the ordering to be like this.

  1. Default flags
    • Controlled by cc-rs.
  2. rustc-inherited flags
    • Controlled by rustc.
  3. Builder flags
    • Controlled by the developer using cc-rs in e.g. their build.rs.
  4. Environment flags
    • Controlled by the end user.

To allow flags set on the builder to override other flags, and to allow
CFLAGS to override _all_ other flags.
@madsmtm madsmtm requested a review from NobodyXu February 24, 2025 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants